<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>留言管理</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" type="text/css" href="/Public/admin/layui/css/layui.css" media="all">
  <link rel="stylesheet" type="text/css" href="/Public/admin/bootstrap/css/bootstrap.css" media="all">
  <link rel="stylesheet" type="text/css" href="/Public/admin/global.css" media="all">
  <link rel="stylesheet" type="text/css" href="/Public/admin/css/personal.css" media="all">
  <link rel="stylesheet" type="text/css" href="/Public/admin/css/page.css" media="all">
</head>
<body>
<section class="layui-larry-box">
  <div class="larry-personal">
    <header class="larry-personal-tit">
      <span>客户留言管理</span>
    </header><!-- /header -->
    <table class="layui-table">
    <colgroup>
      <col width="150">
      <col width="850">
      <col>
    </colgroup>
    <thead>
      <tr>
        <th>ID</th>
        <th>内容</th>
        <th>操作</th>
      </tr> 
    </thead>
    <tbody>
      <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
          <td><?php echo ($vo["id"]); ?></td>
          <td>
            <span>姓名: </span><?php echo ($vo["name"]); ?> <span>邮箱: </span><?php echo ($vo["email"]); ?><br>
            <span>留言: </span><?php echo ($vo["message"]); ?><br>
            <span>留言时间: </span><?php echo (date("Y-m-d H:i:s",$vo["addtime"])); ?><br>
            <?php if($vo['retime']): ?><span>&nbsp;&nbsp;&nbsp;回复: </span><br>&nbsp;&nbsp;&nbsp;<?php echo ($vo["reply"]); ?><br>
              &nbsp;&nbsp;&nbsp;<?php echo (date("Y-m-d H:i:s",$vo["retime"])); endif; ?>
          </td>
          <td> 
            <a href="/admin/guest/reply/id/<?php echo ($vo["id"]); ?>"><button class="layui-btn">回复</button></a>
            <a href="/admin/guest/del/id/<?php echo ($vo["id"]); ?>"><button class="layui-btn layui-btn-normal">删除</button></a>
            <a href="/admin/guest/send/id/<?php echo ($vo["id"]); ?>" target="_blank"><button class="layui-btn layui-btn-danger">转发至邮箱</button></a>
          </td>
        </tr><?php endforeach; endif; else: echo "" ;endif; ?>
    </tbody>
    </table>
     <div id="page" class="green-black"><?php echo ($page); ?></div>
  </div>
</section>
<script src="/Public/admin/layui/layui.js" charset="utf-8"></script>
<script>
layui.use(['layer','form','laydate'], function(){
  var layer = layui.layer,
  laydate = layui.laydate,
  form = layui.form();
});
function openurl(id){
   layer.open({
    title:'邮箱选择',
    type: 2,
    area: ['700px','500px'],
    fixed: false, //不固定
    maxmin: true,
    content: '/index.php/Admin/Guest/send/id/'+id,//路径,把留言的id传过去
  });
}
</script>
</body>
</html>